import React from 'react';
import {useMatch} from 'react-router-dom'
import ErrorPage from '../../components/ErrorPage';

const ErrorRoute = (props) => {
    const match = useMatch()
    const code = match.params.code;
    return (!code || code === '404') ? <ErrorPage /> : <ErrorPage code="403" tips="啊哦~ 你没有权限访问该页面哦"/>
}

export default ErrorRoute;